package jtk.project4.fleet.field;

import java.awt.FlowLayout;

import jtk.project4.fleet.domain.PmHist;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TextField;
//import nl.coderight.jazz.form.field.table.TableFieldColumn;

public class RepairsField extends GroupControl{
	private TableField<PmHist> rprTable;
	private TextField rprcost1Field;
	private TextField rprcost2Field;
	private TextField rprcost3Field;
	//private TableFieldColumn description;
	
	
	public RepairsField(String bindID){
		setBindID(bindID);
		createFields();
		createLayout();
		
	}
	
	
	private void createLayout() {
		// TODO Auto-generated method stub
		setLayout(new FormLayout ())
		.addField(rprTable);
	}


	private void createFields(){
		rprTable = new TableField<PmHist>("pmHists","pmHist");
		rprTable.addColumn("Repairs", "mtcPerf");
		rprTable.addColumn("Part Cost", "pCost");
		rprTable.addColumn("Labor Cost", "lCost");
		rprTable.addColumn("Total Cost", "cost");
		rprTable.addColumn("% of Total", "0");
		
		rprcost1Field = new TextField("pCost",10);
		rprcost1Field.setEditable(false);
		rprcost2Field = new TextField("lCost",10);
		rprcost2Field.setEditable(false);
		rprcost3Field = new TextField("cost",10);
		rprcost3Field.setEditable(false);
	
	}
	
	private GroupControl createTableFieldColumn() {
		GroupControl tableFieldColumn = new GroupControl();
		tableFieldColumn.setLayout(new FlowLayout(FlowLayout.CENTER));
		tableFieldColumn.focusField(rprTable);
		return tableFieldColumn;
	}


}
